#pragma once
#ifndef RENDER_H
#define RENDER_H

#include <vector>
#include <SFML/Graphics.hpp>
#include "DebugView.h"
#include "AnimatedSprite.h"
#include "Player.h"

class Render
{
public:

	Render(sf::RenderWindow* window);

	virtual ~Render();

	DebugView* getDebugView();

	void addSprite(const sf::Sprite& sprite);

	void clear();

	void update(float timeStep);

	void setPlayer(Player* player);

private:

	sf::Vector2f convertToScreen(const b2Vec2& physicsVector) const;

	std::vector<sf::Sprite> sprites;

	std::vector<AnimatedSprite> animatedSprites;

	sf::RenderWindow* window;

	sf::View scrollView;

	float pixelViewFactor;
	
	const float physicsViewFactor;

	DebugView debugView;

	Player* player;

	sf::Font arial;

	sf::String fps;

	int benchIterations;

	float avgElapsedTime;
};

#endif //RENDER_H
